package xyz.heyaoshare;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * 程序启动类
 * @author YueHe
 * @version 0.0.1
 * @since 2025/6/25 上午10:14
 */
@Slf4j
@SpringBootApplication
public class Application {

    public static final String SPRING_PROFILES_ACTIVE = "spring.profiles.active";
    public static final String LOG_STR = "项目启动成功! --> 环境：{}";

    public static void main(String[] args) {
        log.info("应用启动中...");
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Application.class, args);
        String env = applicationContext.getEnvironment().getProperty(SPRING_PROFILES_ACTIVE);
        log.info(LOG_STR, env);
    }

}
